<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .title {
            margin: 10px;
            display: flex;
            justify-content: space-between;
        }

        .title span {
            font-weight: bolder;
        }

        .box {
            height: 140px;
        }

        .shop {
            float: left;
        }

        img {
            width: 100px;
            height: 100px;
            margin: 10px;
        }

        h4 {
            padding-top: 10px;
        }

        .jg {
            display: flex;
            margin-top: 50px;
        }

        .price {
            margin-right: 60px;
        }

        .add span {
            display: inline-block;
            width: 14px;
            height: 14px;
            text-align: center;
            line-height: 14px;
            background-color: steelblue;
            color: white;
            border-radius: 50%;
        }

        .add span:nth-child(2) {
            color: black;
            background-color: white;
        }

        .qk {
            line-height: 60px;
            text-align: center;
        }

        .zj {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #f5f5f5;
            left: 0;
            position: fixed;
            bottom: 0;
            width: 100%;
            padding: 20px;
            box-sizing: border-box;
        }
    </style>
</head>

<body>
    <div id="buyCar">
        <div class="title">
            <span>已选商品</span>
            <span @click="clean">清空</span>
        </div>
        <div v-for="(item,index) in shopArr" class="box">
            <div class="shop"><img v-bind:src="item.pic"></div>
            <div class="pr">
                <h4>{{item.name}}</h4>
                <div class="jg">
                    <div class="price">{{item.price}}</div>
                    <div class="add">
                        <span @click="sub(item)">-</span>
                        <span>{{item.count}}</span>
                        <span @click="add(item)">+</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="qk" v-show="shopArr.length == 0">购物车暂时没有商品,去挑选商品吧!</div>
    </div>




    <script src="./vue-2.5.21.js"></script>
    <script src="./购物车.js"></script>
</body>

</html>